#pragma once
#include <vector>
#include <ctime>

using std::vector;

enum StateList
{
   STATE_NOTSET = -1,
   STATE_LOADINGSCREEN,
   STATE_TITLESCREEN,
   STATE_MAINMENU,
   STATE_MAINGAME,
   STATE_OPTIONS,
   STATE_PAUSE,
   STATE_ENDGAME,
   STATE_SHUTDOWN,
   STATE_MAX
};

class BaseState;

class GameManager
{
private:
   bool m_bGameRunning;
   StateList m_eCurGameState;
   clock_t m_iStartTime;
   float m_fCurTime;

   vector<BaseState *> m_vStates;

   GameManager(void);
   ~GameManager(void);

   static GameManager * m_pInstance;
public:
   static GameManager * GetInstance();
   void Update();
   void GetInput();
   void Init();
   void Render();
   void Shutdown();

   // Accessors
   StateList GetGameState(){return m_eCurGameState;}
   BaseState * GetGameStatePtr(StateList eState);
   bool IsGameRunning(){return m_bGameRunning;}

   // Modifiers
   void SetGameState(StateList eState);
};

